﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DataCore; 
using DataCore.DomainObjects;
using ExpertSystem.ObjectDBService;
using ExpertSystem.Views;

namespace ExpertSystem
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MetaClass n = new MetaClass("TestClass");
            AtributeType atributeType = new AtributeType();
            atributeType.AtrType = "".GetType();
            Atribute attribute = new Atribute(atributeType, "name");
            n.AddAtribute(attribute);
            CurrentObject currentObject = new CurrentObject(n);
            Value value = new Value(attribute);
            //value.BinaryValue = "String";
            currentObject.AttacheValue(value);
            Value c = currentObject.GetByName("name");
            String s = c.GetAsString();
            List<CurrentObject> objects = new List<CurrentObject>();
            objects.Add(currentObject);
            
        }

        private void тестToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            MetaClass metaClass = new MetaClass("Class");
            List<AtributeType> atributeTypes = new List<AtributeType>();
            atributeTypes.Add(new AtributeType("String"));
            atributeTypes.Add(new AtributeType("Integer"));
            Views.CreateNewClassView createNewClassView = new CreateNewClassView(atributeTypes, metaClass);
            createNewClassView.ShowDialog();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            
            var objectDbServiceClient = new ObjectDBServiceClient();
            if (objectDbServiceClient.IsItOnline())
            {
                MessageBox.Show("Hellow!");
            }
        }
    }
}
